Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-flip-move

Package Overview
Dependencies
Maintainers
2
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-flip-move

Effortless animation between DOM changes (eg. list reordering) using the FLIP technique.

  • 3.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
23K
decreased by-80.87%
Maintainers
2
Weekly downloads
 
Created

What is react-flip-move?

react-flip-move is a library for animating the reordering of elements in a list. It uses the FLIP (First, Last, Invert, Play) technique to achieve smooth animations when elements are added, removed, or moved within a list.

What are react-flip-move's main functionalities?

Basic Usage

This example demonstrates the basic usage of react-flip-move. It animates the reordering of a list of items.


import React from 'react';
import FlipMove from 'react-flip-move';

class MyComponent extends React.Component {
  state = { items: ['item1', 'item2', 'item3'] };

  render() {
    return (
      <FlipMove>
        {this.state.items.map(item => (
          <div key={item}>{item}</div>
        ))}
      </FlipMove>
    );
  }
}

Custom Animation Duration

This example shows how to customize the animation duration. The `duration` prop is set to 750 milliseconds.


import React from 'react';
import FlipMove from 'react-flip-move';

class MyComponent extends React.Component {
  state = { items: ['item1', 'item2', 'item3'] };

  render() {
    return (
      <FlipMove duration={750}>
        {this.state.items.map(item => (
          <div key={item}>{item}</div>
        ))}
      </FlipMove>
    );
  }
}

Custom Easing

This example demonstrates how to use a custom easing function for the animations. The `easing` prop is set to a cubic-bezier function.


import React from 'react';
import FlipMove from 'react-flip-move';

class MyComponent extends React.Component {
  state = { items: ['item1', 'item2', 'item3'] };

  render() {
    return (
      <FlipMove easing="cubic-bezier(0.25, 0.1, 0.25, 1)">
        {this.state.items.map(item => (
          <div key={item}>{item}</div>
        ))}
      </FlipMove>
    );
  }
}

Other packages similar to react-flip-move

Keywords

FAQs

Package last updated on 02 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc